In [1]:
%matplotlib inline
from ggplot import *

Saving Plots to a File

Saving plots in ggplot is easy. Just use the save method of your ggplot object.


In [2]:
p = ggplot(aes(x='mpg'), data=mtcars) + geom_histogram()
print p
p.save("myplot.png")


<ggplot: (284428741)>

And voilà. If you take a look at myplot.png you can see that we've saved our plot to a file

# markdown syntax for opening an image
![](./myplot.png)


In [ ]: